package cate.game.activity.base.core;

import cate.game.role.RoleDependent;
import com.fasterxml.jackson.annotation.JsonIgnore;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;
import org.springframework.data.annotation.Transient;

@NoteClass("个人活动子数据")
public class SubActivitySingle<T extends RoleActivitySingle> extends RoleDependent {
    @NoteField("关联的活动数据")
    @JsonIgnore
    @Transient
    public T parent;

    public void initialize(T parent) {
        super.initialize(parent.getRole());
        this.parent = parent;
    }

    public boolean enable() {
        return parent.enable();
    }

    @JsonIgnore
    public int funcId() {
        return parent.base.funcId;
    }
}
